package org.rency.common.messager.service;

import org.rency.common.messager.beans.EmailEntity;
import org.rency.common.messager.beans.SMSAlidayuEntity;
import org.rency.common.messager.beans.SMSWebChineseEntity;
import org.rency.common.messager.exception.MessageException;
import org.springframework.mail.MailException;

public interface MessageService {

	/**
	 * 发送邮件
	 * @param entity 邮件实体
	 * @return
	 * @throws MailException
	 */
	public boolean sendEmail(EmailEntity entity) throws MessageException;
	
	/**
	 * 发送邮件
	 * @param from 发件人
	 * @param target 收件人
	 * @param subject 主题
	 * @param content 内容
	 * @param isHtml 是否html格式发送
	 * @return
	 * @throws MailException
	 */
	public boolean sendEmail(String from,String target,String subject,String content,boolean isHtml) throws MessageException;

	/**
	 * 中国网建发送短信
	 * @param entity 短信实体
     * @return
     */
	public boolean sendSMS(SMSWebChineseEntity entity) throws MessageException;
	
	/**
	 * 阿里大鱼发送短信
	 * @param entity 短信实体
     * @return
     */
	public boolean sendSMS(SMSAlidayuEntity entity) throws MessageException;
}